// index.js
// 获取应用实例
const app = getApp()

Page({
	data: {
		code: '',
		info: {}
	},
	onLoad() {
	},
	getCode(e) {
		this.setData({ code: e.detail.value })
	},
	showInfo() {
		const _this = this;
		// 发送请求
		wx.request({
			url: 'http://localhost:8082/search?code=' + _this.data.code,
			success: function (res) {
				_this.setData({ info: res.data })
				wx.redirectTo({
					url: '/pages/info/index?info=' +JSON.stringify( _this.data.info),
				})
			}
		})

	}
})
